# -*- coding: utf-8 -*-

import subprocess
import sys
from logger import *
from config import *

name = str(sys.argv[1])

# 执行命令并检查错误
try:
    logger.info('syn main start')
    for int_svr in svr_list:
        str_svr = str(int_svr)
        subprocess.run(['python3', 'stop_state.py', str_svr, name], cwd=python_path)
    logger.info('syn main end')

except subprocess.CalledProcessError as error:
    logger.error('syn ERROR')
    # 在这里可以处理命令执行失败的情况